from django.db import models

class CommodityInfos(models.Model):

    name = models.CharField('商品名称', max_length=100)
    sezes = models.CharField('颜色规格', max_length=100)
    types = models.CharField('商品类型', max_length=100)

    price = models.FloatField('商品价格', default=0)
    discount = models.FloatField('折后价格', default=0)
    stock = models.IntegerField('存货数量', default=0)
    sold = models.IntegerField('已售数量', default=0)
    likes = models.IntegerField('收藏数量', null=True)
    created = models.DateField('上架日期', auto_now_add=True)
    img = models.ImageField('商品主图', upload_to=r'imgs', null=True)


